<!DOCTYPE HTML>
<html lang="en" class="rust sidebar-visible" dir="ltr">
    <head>
        <!-- Book generated using mdBook -->
        <meta charset="UTF-8">
        <title>Rusted PackFile Manager Documentation</title>
        <meta name="robots" content="noindex">


        <!-- Custom HTML head -->

        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="theme-color" content="#ffffff">

        <link rel="icon" href="favicon.svg">
        <link rel="shortcut icon" href="favicon.png">
        <link rel="stylesheet" href="css/variables.css">
        <link rel="stylesheet" href="css/general.css">
        <link rel="stylesheet" href="css/chrome.css">
        <link rel="stylesheet" href="css/print.css" media="print">

        <!-- Fonts -->
        <link rel="stylesheet" href="FontAwesome/css/font-awesome.css">
        <link rel="stylesheet" href="fonts/fonts.css">

        <!-- Highlight.js Stylesheets -->
        <link rel="stylesheet" id="highlight-css" href="highlight.css">
        <link rel="stylesheet" id="tomorrow-night-css" href="tomorrow-night.css">
        <link rel="stylesheet" id="ayu-highlight-css" href="ayu-highlight.css">

        <!-- Custom theme stylesheets -->


        <!-- Provide site root and default themes to javascript -->
        <script>
            const path_to_root = "";
            const default_light_theme = "rust";
            const default_dark_theme = "navy";
            window.path_to_searchindex_js = "searchindex.js";
        </script>
        <!-- Start loading toc.js asap -->
        <script src="toc.js"></script>
    </head>
    <body>
    <div id="mdbook-help-container">
        <div id="mdbook-help-popup">
            <h2 class="mdbook-help-title">Keyboard shortcuts</h2>
            <div>
                <p>Press <kbd>←</kbd> or <kbd>→</kbd> to navigate between chapters</p>
                <p>Press <kbd>S</kbd> or <kbd>/</kbd> to search in the book</p>
                <p>Press <kbd>?</kbd> to show this help</p>
                <p>Press <kbd>Esc</kbd> to hide this help</p>
            </div>
        </div>
    </div>
    <div id="body-container">
        <!-- Work around some values being stored in localStorage wrapped in quotes -->
        <script>
            try {
                let theme = localStorage.getItem('mdbook-theme');
                let sidebar = localStorage.getItem('mdbook-sidebar');

                if (theme.startsWith('"') && theme.endsWith('"')) {
                    localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
                }

                if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
                    localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
                }
            } catch (e) { }
        </script>

        <!-- Set the theme before any content is loaded, prevents flash -->
        <script>
            const default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? default_dark_theme : default_light_theme;
            let theme;
            try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
            if (theme === null || theme === undefined) { theme = default_theme; }
            const html = document.documentElement;
            html.classList.remove('rust')
            html.classList.add(theme);
            html.classList.add("js");
        </script>

        <input type="checkbox" id="sidebar-toggle-anchor" class="hidden">

        <!-- Hide / unhide sidebar before it is displayed -->
        <script>
            let sidebar = null;
            const sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
            if (document.body.clientWidth >= 1080) {
                try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
                sidebar = sidebar || 'visible';
            } else {
                sidebar = 'hidden';
                sidebar_toggle.checked = false;
            }
            if (sidebar === 'visible') {
                sidebar_toggle.checked = true;
            } else {
                html.classList.remove('sidebar-visible');
            }
        </script>

        <nav id="sidebar" class="sidebar" aria-label="Table of contents">
            <!-- populated by js -->
            <mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox>
            <noscript>
                <iframe class="sidebar-iframe-outer" src="toc.html"></iframe>
            </noscript>
            <div id="sidebar-resize-handle" class="sidebar-resize-handle">
                <div class="sidebar-resize-indicator"></div>
            </div>
        </nav>

        <div id="page-wrapper" class="page-wrapper">

            <div class="page">
                <div id="menu-bar-hover-placeholder"></div>
                <div id="menu-bar" class="menu-bar sticky">
                    <div class="left-buttons">
                        <label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
                            <i class="fa fa-bars"></i>
                        </label>
                        <button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
                            <i class="fa fa-paint-brush"></i>
                        </button>
                        <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
                            <li role="none"><button role="menuitem" class="theme" id="default_theme">Auto</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
                        </ul>
                        <button id="search-toggle" class="icon-button" type="button" title="Search (`/`)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="/ s" aria-controls="searchbar">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>

                    <h1 class="menu-title">Rusted PackFile Manager Documentation</h1>

                    <div class="right-buttons">
                        <a href="print.html" title="Print this book" aria-label="Print this book">
                            <i id="print-button" class="fa fa-print"></i>
                        </a>

                    </div>
                </div>

                <div id="search-wrapper" class="hidden">
                    <form id="searchbar-outer" class="searchbar-outer">
                        <div class="search-wrapper">
                            <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
                            <div class="spinner-wrapper">
                                <i class="fa fa-spinner fa-spin"></i>
                            </div>
                        </div>
                    </form>
                    <div id="searchresults-outer" class="searchresults-outer hidden">
                        <div id="searchresults-header" class="searchresults-header"></div>
                        <ul id="searchresults">
                        </ul>
                    </div>
                </div>

                <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
                <script>
                    document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
                    document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
                    Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
                        link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
                    });
                </script>

                <div id="content" class="content">
                    <main>
                        <h1 id="whats-rpfm"><a class="header" href="#whats-rpfm">What's RPFM?</a></h1>
<p><img src="./images/image1.png" alt="This how Rusted PackFile Manager looks on a sunny day on the beach." /></p>
<p>This is <strong>Rusted PackFile Manager</strong>, a.k.a. <strong>RPFM</strong>, a modding tool for modern Total War Games.</p>
<p>Before explaining what it does, a <strong>little explanation</strong> on how modding works in Total War games since Empire is due. Since Empire, most of the data of Total War games is in <code>.pack</code> files, packed together so it's faster to read for the game. Those <code>.pack</code> files are <em>containers</em>. Inside them there are a ton of files with the actual data of the game. Some of those files are:</p>
<ul>
<li><strong>DB Tables</strong>: contains most of the modable stuff of the game, like unit stats, building info,.... They are always in the folder <code>db/whatever_tables/table_file</code>.</li>
<li><strong>LOCs</strong>: contains the actual text you see on the screen when playing the game. Yeah, all those letters are not unicorn magic. It's hard to believe, I know, but it's true.</li>
<li><strong>Lua/Txt/Xml/...</strong>: plain text files. Not rocket science.</li>
<li><strong>RigidModels</strong>: the files with the actual 3D models of almost everything you see in the game, like units, monsters,....</li>
<li><strong>Images</strong>: icons, textures, etc....</li>
</ul>
<p>Now, how it's modding done in modern Total War Games? By creating a <code>mod</code> Pack, adding some of those files, changing them, and then telling the launcher to use that mod with the changes you did. Simple isn't? Now, <em><strong>what is RPFM?</strong></em> It's a program that let's you create and edit those Packs, allowing you to edit the tables, locs,... inside them too. That's more or less what it is.</p>
<p>But hey, isn't this familiar? If you have modded a modern Total War game, yep. RPFM started as a <em>complete reimplementation</em> in Rust and Qt5 of the old <strong>PackFile Manager</strong>, because PFM it's slow, buggy, and was unmaintained for more than half a year before someone picked it up, but it grew past it. If you've used PFM before, you can see it has a similar UI, and most of the features are in the same place, or close by. It's done that way to make it <em><strong>easier to use for modders</strong></em> coming from PFM.</p>
<p>So, you want to give it a try? Then read the <strong><img src="./chapter_2.html" alt="Initial Configuration" /></strong> section, as without it most of the <em>Advanced Features</em> RPFM has are disabled. And remember, you can always access this documentation by clicking on the <code>Open RPFM Manual</code> at the bottom right of the screen.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="initial-configuration"><a class="header" href="#initial-configuration">Initial Configuration</a></h1>
<p><img src="./images/image2.png" alt="Preferences... everyone has them." /></p>
<p>After we start RPFM for the first time, we have to configure a couple of things.</p>
<p>First, it should promt you to update your schemas. Hit yes. Schemas are files used to be able to edit tables, so you need them. Just remember you should always have them up-to-date.</p>
<p>Then, we need to go to <code>Pack/Settings</code>, and the window above this will popup. It seems like a lot of new stuff to know, but it's really simple. First the paths:</p>
<ul>
<li><code>Game folder</code>: These are the folders where your games are. Not where /data is, but <strong>WHERE THE .EXE IS!!!</strong> RPFM uses them for plenty of things, so remember to set them for the games you have.</li>
<li><code>Assembly Kit folder</code>: These are the folders where the Assembly Kit for each game is installed, if any.</li>
<li><code>MyMod's folder</code>: it's the path where your <em><strong>MyMod</strong></em> will be stored. <em><strong>MyMod</strong></em> are explained in a later chapter of this documentation, so for now you just need to know that it's a path RPFM will use to store stuff for your mods. Set it pointing to an empty folder.</li>
<li><code>7-Zip Folder</code>: if you have 7-Zip installed, put here the folder where the 7-Zip exe is. This is needed to support compression. Without it, if you try to compress a Pack, it'll fail.</li>
</ul>
<p>Next, all those checkboxes. You can get an explanation about what they do just by hovering them with the mouse, like this.</p>
<p><img src="./images/image4.png" alt="Hovering before it was cool!." /></p>
<p>Next, the Text Editor button. This controls all the settings relative to the text editor, including his theme.</p>
<p><img src="./images/image3.png" alt="Yes, you can make it darker here..." /></p>
<p>And finally, the <code>Shortcuts</code> button. Hitting it will open the <code>Shortcuts</code> window, where you can see and edit all the shortcuts currently used by RPFM.</p>
<p><img src="./images/image5.png" alt="Shortcuts are little cuts...." /></p>
<p>Just keep in mind that some of <strong>the shortcuts are applied when the program starts</strong>, so you'll have to close and re-open RPFM for the changes to take effect.</p>
<p>When you're done with the settings, just hit <code>Save</code>. You can restore them to the defaults with the button of the left (same for the shortcuts with their <code>Restore Defaults</code> button). One thing to take into account is that, if any of the paths is invalid, RPFM will delete it when hitting <code>Save</code>.</p>
<p>Now the last step. This is optional, but recommendable and it <strong>requires you to have the Assembly Kit</strong> for your games installed. We have to go to <code>Special Stuff</code> and, for each game we have, hit <code>Generate Dependency Cache</code>. This will create a special file that will help RPFM with reference data for table columns. It's <strong>not enabled for Empire and Napoleon</strong> for now, but it should work for every other game.</p>
<p>With that, we have completed the initial configuration. So now that we're done configuring RPFM, let's take a look at the features it has to offer.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="buttons-and-what-they-do"><a class="header" href="#buttons-and-what-they-do">Buttons and What They Do</a></h1>
<p>In this chapter we will check every freaking <em>general use</em> button and hidden action RPFM has (PackedFile-specific actions are in their respective chapter), so you don't have to ask what they do. Just remember that, in addition to this chapter, you can <strong>hover with the mouse over almost every button</strong> in RPFM and in the status bar at the bottom will appear a short message explaining what the button do.</p>
<p>Ere we go!</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="menu-bar"><a class="header" href="#menu-bar">Menu Bar</a></h1>
<p>First, the top Menu bar. It has five menus in it, that'll be explained in the following chapters. But to give you an idea of what we have:</p>
<ul>
<li><code>Pack</code>: It's where all the <em>basic</em> stuff like <code>New</code>, <code>Open</code> and <code>Save</code> is. Pretty straightforward.</li>
<li><code>MyMod</code>: It's where all the stuff related with the use of the <code>MyMod</code> feature is.</li>
<li><code>View</code>: It's where you can hide/show certain panels of the UI.</li>
<li><code>Game Selected</code>: It's where you select the game you are modding the current Pack for if RPFM failed to select it for you.</li>
<li><code>Special Stuff</code>: It's where weird stuff goes.</li>
<li><code>Tools</code>: It's where specialized tools, like the faction painter and the unit editor, go.</li>
<li><code>About</code>: It's where you go when you want to read this documentation, check the Patreon, or check what version of RPFM you have.</li>
<li><code>Debug</code>: Stay away from this.
And now, let's begin!</li>
</ul>
<div style="break-before: page; page-break-before: always;"></div><h1 id="packfile-menu"><a class="header" href="#packfile-menu"><code>PackFile</code> Menu</a></h1>
<p><img src="./images/image6.png" alt="Menuses..." /></p>
<p>Here, we can find the <em>basic</em> actions:</p>
<ul>
<li><code>New PackFile</code>: Creates a new PackFile outtanowhere.</li>
<li><code>Open PackFile</code>: Opens one or more PackFiles in RPFM.</li>
<li><code>Save PackFile</code>: Saves the changes done in a PackFile to disk.</li>
<li><code>Save PackFile As</code>: Saves the current PackFile with another name.</li>
<li><code>Settings</code>: Open the Settings window.</li>
<li><code>Quit</code>: Makes you enter in a lottery. Seriously.</li>
</ul>
<p>And some more... <em>specific</em> ones:</p>
<ul>
<li><code>Install</code>: Copies the currently open PackFile to the data folder of the game.</li>
<li><code>Unistall</code>: Removes the currently open PackFile from the data folder of the game.</li>
<li><code>Open Recent…/xxx.pack</code>: Open a recently open PackFile.</li>
<li><code>Open From Content…/xxx.pack</code>: Open the selected PackFile from the <em>Content</em> folder (Workshop mods) of the game. Requires the game's path to be configured.</li>
<li><code>Open From Data…/xxx.pack</code>: Open the selected PackFile from the <em>Data</em> folder of the game. Requires the game's path to be configured.</li>
<li><code>Open From Autosave…/xxx.pack</code>: Open the selected PackFile from the <em>Autosave</em> folder. The autosaves are Per-Pack and sorted from newest to oldest, so if you want to load the last autosave done, pick the first one.</li>
<li><code>Load All CA PackFiles</code>: Creates a fake PackFile in memory and tries to load into it all the data from every Vanilla PackFile of the game. Keep in mind that this takes a while. Disabled if you have dependencies loaded in the dependencies panel.</li>
<li><code>Change PackFile Type</code>: Allows you to change the open PackFile's Type and configure some options for it.</li>
</ul>
<p>About the <strong>PackFile Types</strong>, it's what the game uses to <em>load in order</em> all the data of the game. There are the following types, in <em>the order the game will load them</em>:</p>
<ul>
<li><code>Boot</code>: Used by <em>boot.pack</em>. Not useful for modding. First to load.</li>
<li><code>Release</code>: Used by most of CA PackFiles. Not useful for modding.</li>
<li><code>Pactch</code>: Used by some CA PackFiles, specially in Shogun 2 and older games. Not useful for modding.</li>
<li><code>Mod</code>: Used by most mods. This is the one you'll mostly use.</li>
<li><code>Movie</code>: Used by some CA PackFiles and some specific mods. Useful for modding. Last to load.</li>
<li><code>Other</code>: Something for RPFM to categorize unrecognized types. Never use it.</li>
</ul>
<p>There are also a few more options to configure a PackFiles under this menu:</p>
<ul>
<li><code>Header Is Extended</code>: The header of the PackFile is extended (only seen in arena).</li>
<li><code>Index Includes Timestamp</code>: There is a timestamp, maybe a <em>Last Modified Date</em> in the index of the PackFile.</li>
<li><code>Index Is Encrypted</code>: The index of the PackFile is encrypted.</li>
<li><code>Data Is Encrypted</code>: The data of the PackFile is encrypted.</li>
<li><code>Data Is Conpressed</code>: The data of the PackFile is compressed.</li>
</ul>
<p>About these options, just take into account that any PackFile with any of these options enabled (except <code>Data Is Compressed</code>) will <strong>NOT BE RECOGNIZED</strong> as a mod by the launcher. And RPFM doesn't support saving PackFiles with <code>Index Is Encrypted</code>, <code>Data Is Encrypted</code> or <code>Header Is Extended</code> enabled.</p>
<p>And, if you don't enable <code>Allow Editing of CA PackFiles</code>, RPFM will not let you save <code>Boot</code>, <code>Release</code> or <code>Patch</code> PackFiles.</p>
<p>And with that, we finish the <code>PackFile</code> Menu. Next, the <code>MyMod</code> menu.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="mymod-menu"><a class="header" href="#mymod-menu"><code>MyMod</code> Menu</a></h1>
<p><img src="./images/image7.png" alt="MyMod.... more like OurMod...." /></p>
<p><code>MyMod</code> is a feature to help modders <strong>keep their mod's data organized</strong>. The system started as an almost 1:1 clone of PFM's <em>MyMod</em> feature and expanded from there, so it should be easy to use for veterans too.</p>
<p>For those new to the concept, remember that <code>MyMod</code> folder we set in the settings? When we create a <code>MyMod</code>, in that folder will be created a folder for the game the mod's for (if it didn't exist before), and inside that there will be a PackFile and a folder, both with the name of your mod. Each time you extract something from the PackFile, it'll be automatically extracted in his folder, <strong>mirroring the structure it has in the PackFile</strong>. For example, extracting a table will result in the table being extracted at <code>mymod_folder/db/table_name/file</code>. Adding Files/Folders from the MyMod folder <strong>will also add them mirroring the path they have</strong>. For example, adding a file from <code>mymod_folder/db/table_name/file</code>_ will add the file in <code>PackFile/db/table_name/file</code>.</p>
<p>This makes easier to keep track of the mod files, and you can even <strong>put that folder under .git</strong>, or any other version control system, as you can have an unpacked mod that you can pack with a single click (well, a few clicks).</p>
<p>The <code>MyMod</code> Menu has the following buttons:</p>
<ul>
<li><code>Open MyMod Folder</code>: Opens the <code>MyMod</code> folder in your default file explorer.</li>
<li><code>New MyMod</code>: It opens the <code>New MyMod</code> Dialog. It's explained under this list.</li>
<li><code>Delete Selected MyMod</code>: It deletes the currently selected <code>MyMod</code>. This cannot be undone, so you'll got a warning before doing it.</li>
<li><code>Import</code>: Import the content of the <code>MyMod</code> folder of the currently open <code>MyMod</code> PackFile into said PackFile.</li>
<li><code>Export</code>: Extract the current <code>MyMod</code> PackFile into its <code>MyMod</code> folder.</li>
<li><code>XXX/yourmod.pack</code>: Open your previously created <code>MyMod</code> to edit, delete, install,.... whatever you want, baby!</li>
</ul>
<p>When we click on <code>New MyMod</code>, the following dialog will appear:</p>
<p><img src="./images/image8.png" alt="I said OURMOD!!!!" /></p>
<p>Here you can configure the <code>MyMod</code> with the features you want. Once you're done, hit <code>Save</code> and your new <code>MyMod</code> will be created and opened.</p>
<p>And lastly, a couple of aclarations:</p>
<ul>
<li>To be able to use <code>Import/Export</code> you need to have your <code>MyMod</code> open.</li>
<li>Only <code>MyMod</code> PackFiles opened from <code>XXX/yourmod.pack</code> will enjoy the <code>MyMod</code> features, like keeping the paths when adding/extracting files. Manually opened <code>MyMod</code> PackFiles will be treated as regular PackFiles.</li>
</ul>
<div style="break-before: page; page-break-before: always;"></div><h1 id="view-menu"><a class="header" href="#view-menu"><code>View</code> Menu</a></h1>
<p>In this menu you can hide/show certain panels of the UI:</p>
<ul>
<li><code>PackFile Contents</code>: That thing on the left with files and folders on it.</li>
<li><code>Global Search</code>: A panel to search stuff through the entire open PackFile.</li>
<li><code>Diagnostics</code>: A panel to show diagnostics results of the entire open PackFile.</li>
<li><code>Dependencies</code>: A panel to show all the currently loaded dependencies.</li>
<li><code>References</code>: A panel to show references found with the <code>Find References</code> feature.</li>
</ul>
<div style="break-before: page; page-break-before: always;"></div><h1 id="game-selected-menu"><a class="header" href="#game-selected-menu"><code>Game Selected</code> Menu</a></h1>
<p><img src="./images/image9.png" alt="I&#39;m a man of many games..." /></p>
<p>In this menu you can <strong>change the currently selected game</strong>. When opening PackFiles, RPFM tries to be smart and auto-select a game, but there are some PackFiles that are the same between games (for example, Attila and Warhammer 1 PackFiles are identical), so... just make sure the right game is selected after opening a PackFile, as that affects how many parts of the program work. The complete list of supported games is:</p>
<ul>
<li><code>Warhammer 3</code>: Full Support.</li>
<li><code>Troy</code>: Full Support.</li>
<li><code>Three Kingdoms</code>: Full Support.</li>
<li><code>Warhammer 2</code>: Full Support.</li>
<li><code>Warhammer</code>: Full Support.</li>
<li><code>Thrones of Britannia</code>: Full Support.</li>
<li><code>Attila</code>: Full Support.</li>
<li><code>Rome 2</code>: Full Support.</li>
<li><code>Shogun 2</code>: Full Support.</li>
<li><code>Napoleon</code>: Almost Full Support. Missing <code>Generate Dependencies Cache</code> support.</li>
<li><code>Empire</code>: Almost Full Support. Missing <code>Generate Dependencies Cache</code> support.</li>
<li><code>Arena</code>: Read-Only Support for PackFiles. Incomplete schema.</li>
</ul>
<p>Also, at the top we have a couple of convenient buttons to open certain folders on the default file manager of your system:</p>
<ul>
<li><code>Launch Game Selected</code>: A quick shortcut to launch the currently selected game.</li>
<li><code>Open Game's Data Folder</code>: Open your currently selected game's data folder, if it has his path configured in the settings.</li>
<li><code>Open Game's Assembly Kit Folder</code>: Open your currently selected game's assembly kit folder, if it has his path configured in the settings. Only for Rome 2 and later games.</li>
<li><code>Open RPFM's Config Folder</code>: Open the config folder of RPFM, which contains configs, shortcuts, schemas, crashlogs, porn,....</li>
</ul>
<div style="break-before: page; page-break-before: always;"></div><h1 id="special-stuff-menu"><a class="header" href="#special-stuff-menu"><code>Special Stuff</code> Menu</a></h1>
<p><img src="./images/image10.png" alt="Because you are S.P.E.C.I.A.L!" /></p>
<p>This menu contains... special features implemented for specific games. Basically, any feature that <strong>doesn't really fit in any other place</strong> goes here. Here we have:</p>
<ul>
<li><code>Patch SiegeAI</code>: used in Warhammer 1 &amp; 2 for <strong>creating siege maps that the AI can handle</strong>. Basically, make your map with the stuff required for the AI to work, and then patch his PackFile with this.</li>
<li><code>Optimize PackFile</code>: reduces the size of your PackFile and increase its compatibility with other mods by <em>cleaning</em> certain stuff on your packfile:
<ul>
<li><strong>DB</strong>: Removes unchanged rows from vanilla. If table is empty, it removes it. Ignore files called the same as the vanilla ones (unless you disable that in the settings).</li>
<li><strong>Loc</strong>: Removes unchanged rows from vanilla.</li>
<li><strong>Xml</strong>: Removes xml files under the <code>terrain/tiles</code> folder, as those are leftovers of Terry's exports..</li>
</ul>
</li>
<li><code>Generate Dependencies Cache</code>: generates a cache used for things like dependency checking, diagnostics, .... Doesn't work for Empire and Napoleon, yet.</li>
<li><code>Live Export</code>: Exports all script and ui files from the open Pack to the game's data folder with a random number attached, and puts all path mappings into a file in the exe's folder. That way you can, ingame, load that file and it should allow you to load said scripts and ui files without restarting the game.</li>
</ul>
<p>There's also a <code>Rescue PackFile</code> feature that you SHOULD NOT USE UNLESS INSTRUCTED.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="tools-menu"><a class="header" href="#tools-menu"><code>Tools</code> Menu</a></h1>
<p><img src="./images/tools.png" alt="Tooling up!" /></p>
<p>Menu with custom tools integrated in RPFM:</p>
<ul>
<li><code>Faction Painter</code>: Allows you to change the colours of all factions in the game.</li>
<li><code>Unit Editor</code>: Allows you to edit units.</li>
</ul>
<div style="break-before: page; page-break-before: always;"></div><h1 id="about-menu"><a class="header" href="#about-menu"><code>About</code> Menu</a></h1>
<p><img src="./images/image11.png" alt="What do you want to learn about me, honey?" /></p>
<p>Pretty simple and straightforward menu:</p>
<ul>
<li><code>About QT</code>: Shows info about the version of Qt (the framework RPFM uses for the UI) in use.</li>
<li><code>About RPFM</code>: Shows info about the version of RPFM in use, and the credits.</li>
<li><code>Check Updates</code>: Checks if there is a newer version of RPFM available.</li>
<li><code>Check Schema Update</code>: Checks if there is any newer version of RPFM's Schemas available and downloads it.</li>
<li><code>Check TW Autogen Update</code>: Checks if there is any newer version of the TW Autogen lua repo available and downloads it.</li>
</ul>
<p>The <em>Schemas</em> I talked in the last point are what <strong>allows RPFM to decode and open the tables</strong> of all the supported games. Newer schemas means more tables to open. It's very common that after an update a few tables change his structure and are no longer decodables. To get them to work again, the schema has to be updated.</p>
<p>And that's all for the top <code>Menu</code> Bar. Now we'll take a look at the thing you're going to use the most (or almost the most): the <code>TreeView</code>.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="debug-menu"><a class="header" href="#debug-menu"><code>Debug</code> Menu</a></h1>
<p>Stay away from this.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="packfile-treeview"><a class="header" href="#packfile-treeview">PackFile TreeView</a></h1>
<p><img src="./images/image12.png" alt="It&#39;s beautiful..." /></p>
<p>That thing on the left with folders and stuff is the <strong>PackFile's TreeView</strong>. That's where all the files inside your PackFiles will show up. If you don't like it there, it can be moved elsewere, or even closed. When you Right-Click on any of them, this context menu will show up:</p>
<p><img src="./images/image13.png" alt="Contextualize THIS!" /></p>
<p>These are the actions you can use to alter the PackFile. Each one of them has a hotkey, in case you're a lazy bastard. These are all the actions in the menu:</p>
<ul>
<li><code>Add…/Add File</code>: Allows you to add one or more files to the PackFile. If TSV files are detected, RPFM will try to import them as tables/locs.</li>
<li><code>Add…/Add Folder</code>: Allows you to add a folder and all his files to the PackFile. If TSV files are detected, RPFM will try to import them as tables/locs.</li>
<li><code>Add…/Add from PackFile</code>: Allows you to add files or folders from another PackFile to your PackFile. Just, select whatever you want to add, double click it and it'll be added to your PackFile, keeping his path.</li>
<li><code>Create…/Create Folder</code>: Allows you to create an empty folder. Due to how PackFiles work empty folders are not saved so, if you want to keep the folder, add a file to it. Supports relative paths.</li>
<li><code>Create…/Create AnimPack</code>: Allows you to create an empty AnimPack.</li>
<li><code>Create…/Create DB</code>: Allows you to create an empty DB Table.</li>
<li><code>Create…/Create Loc</code>: Allows you to create an empty Loc PackedFile. You can create his relative path too writing something like <code>folder1/folder2/file</code> instead of just the file name.</li>
<li><code>Create…/Create Portrait Settings</code>: Allows you to create a Portrait Settings file. It can be initialized with data from the open mod.</li>
<li><code>Create…/Create Text</code>: Allows you to create an empty text file. ANY TEXT FILE (including lua, xml,...). You can create his relative path too writing something like <code>folder1/folder2/file</code> instead of just the file name.</li>
<li><code>Create…/Create Quick File</code>: Allows you to create a file based on the context. The current contexts where this works are:
<ul>
<li><code>db/x_tables</code>: It creates a new empty db table of the last version supported by the game selected.</li>
<li><code>text/</code>: It creates a loc file.</li>
<li><code>scripts/</code>: It creates a LUA script.</li>
<li><code>variantmeshes/variantmeshdefinitions/</code>: It creates a variantmesh file.</li>
</ul>
</li>
<li><code>Open…/Open with Decoder</code>: Allows you to open a table in the <code>PackedFile Decoder</code>. Only used to decode new tables, so…. You shouldn't touch this.</li>
<li><code>Open…/Open Dependency Manager</code>: Allows you to open the list of dependencies included in the PackFile. Check the next chapter to learn what this <code>Dependency Manager</code> thing is about.</li>
<li><code>Open…/Open Containing Folder</code>: Allows you to open the folder where your open PackFile is (if it's on disk) with the default file manager of your system.</li>
<li><code>Open…/Open PackFile Settings</code>: Allows you to open the PackFile-specific settings of the currently open PackFile.</li>
<li><code>Open…/Open with External Program</code>: Allows you to open a PackedFile with an external program. For tables and locs, some internal magic is done so they're openable in excel/calc/the program your tsv files open with.</li>
<li><code>Open…/Open Notes</code>: Allows you to open a Notes panel, for writing random stuff related to the PackFile.</li>
<li><code>Rename/Move</code>: Allows you to rename/move whatever is selected, except the PackFile.</li>
<li><code>Delete</code>: Allows you to delete whatever is selected. If the PackFile is selected, it removes every file from it.</li>
<li><code>Extract</code>: Allows you to extract whatever is selected out of the PackFile. If whatever you selected is compressed/encrypted, RPFM will decompress/decrypt it before extracting, so the resulting file is usable.</li>
<li><code>Copy Path</code>: Allows you to copy the selected item's path to the clipboard.</li>
<li><code>Merge Tables</code>: Allows you to merge multiple DB/LOC Tables into one.</li>
<li><code>Update Table</code>: Allows you to update the structure of a table to the latest one one used by the game selected.</li>
<li><code>Generate Loc Data</code>: Allows you to generate a list of missing loc entries for your mod.</li>
</ul>
<p>Additionally, with the shortcuts <code>Ctrl++</code> and <code>Ctrl+-</code> you can expand/collapse the entire TreeView.</p>
<p>Keep in mind that the availability of these actions depends on what is selected, and on the currently loaded schemas. For example, you can't add anything if you have selected a PackedFile. Also, keep in mind that if there is a <code>MyMod</code> loaded, some of these actions may work different.</p>
<p>Also, when you add/modify a file, it's marked in the TreeView with the following colour code:</p>
<ul>
<li><strong>Green/Dark Green</strong> : added file.</li>
<li><strong>Yellow/Dark Yellow</strong> : modified file.</li>
<li><strong>Magenta/Dark Magenta</strong> : added AND modified file.</li>
</ul>
<p>This colour code is applied to the parents too, up to the PackFile, so you easily know what you changed since the last time you saved the PackFile.</p>
<p>And last, the  <strong>TreeView Filter</strong>. It's that thing with buttons at the bottom of the TreeView. It allows you to filter the contents of the TreeView by a pattern (Works with Regex!). The buttons below the filter bar where you write the pattern are:</p>
<ul>
<li><code>Auto-Expand Matches</code>: automatically expand all the matched folders/files. This combined with a ton of matches (empty pattern and +60k files in data.pack) can hang the program for a while, so be cautious on when do you use it.</li>
<li><code>AaI</code>: the case sensitive button. Not too much to explain here.</li>
</ul>
<div style="break-before: page; page-break-before: always;"></div><h1 id="dependency-manager"><a class="header" href="#dependency-manager">Dependency Manager</a></h1>
<p><img src="./images/image14.png" alt="Depending...." /></p>
<p>The <code>Dependency Manager</code> allows you to modify a special list of PackFiles saved inside your mod's PackFile. When starting the game, the launcher will try to load the PackFiles in this list BEFORE your PackFile. If a PackFile is not found, it'll be ignored. This list can be used to hardcode dependencies into your PackFile. In his Contextual Menu (right-click) you can find more or less the same commands of a DB Table.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="packfile-settings"><a class="header" href="#packfile-settings">PackFile Settings</a></h1>
<p><img src="./images/packfile_settings.png" alt="Pack me up and Set me free!!!!" /></p>
<p><code>PackFile Settings</code> are a list of PackFile-specific settings, that can change some of RPFM behaviors only for the currently open PackFile. They're kept inside the PackFile, so every time you open that PackFile again, they will be re-applied. The list of settings goes as follows:</p>
<ul>
<li>
<p><strong>PackedFiles to Ignore on Diagnostics Check</strong>: The list of PackedFiles that will be ignored when performing a diagnostics check. You can ignore entire folders, individual PackedFiles, specific columns of individual PackedFiles and specific diagnostics on individual PackedFiles. The format is as follows:</p>
<ul>
<li><code>db/land_units_tables</code> =&gt; All tables in that folder will be ignored.</li>
<li><code>db/land_units_tables/table1</code> =&gt; That exact table will be ignored.</li>
<li><code>db/land_units_tables/table2;field1,field2</code> =&gt; Only those two fields of that specific table will be ignored.</li>
<li><code>db/land_units_tables;field1,field2</code> =&gt; Only those two fields of all tables in that folder will be ignored.</li>
<li><code>db/land_units_tables/table1;;DiagId1,DiagId2</code> =&gt; Only those two diagnostics for that specific table will be ignored.</li>
<li>Comment lines should start with <code>#</code>.</li>
<li>The diagnostic keys used to disable specific diagnostics are:
<ul>
<li><code>OutdatedTable</code> =&gt; Outdated table.</li>
<li><code>InvalidReference</code> =&gt; Invalid reference.</li>
<li><code>EmptyRow</code> =&gt; Empty row.</li>
<li><code>EmptyKeyField</code> =&gt; Empty key field.</li>
<li><code>EmptyKeyFields</code> =&gt; Empty key fields.</li>
<li><code>DuplicatedCombinedKeys</code> =&gt; Duplicated combined keys.</li>
<li><code>NoReferenceTableFound</code> =&gt; No reference table found.</li>
<li><code>NoReferenceTableNorColumnFoundPak</code> =&gt; No reference Table/Column found.</li>
<li><code>NoReferenceTableNorColumnFoundNoPak</code> =&gt; No reference Table/Column/Dependencies found.</li>
<li><code>InvalidEscape</code> =&gt; Invalid escape.</li>
<li><code>DuplicatedRow</code> =&gt; Duplicated row.</li>
<li><code>InvalidLocKey</code> =&gt; Invalid Loc Key.</li>
<li><code>TableNameEndsInNumber</code> =&gt; Table Name ends in number.</li>
<li><code>TableNameHasSpace</code> =&gt; Table name has space.</li>
<li><code>TableIsDataCoring</code> =&gt; Table is data-coring.</li>
<li><code>FieldWithPathNotFound</code> =&gt; Path/File in Field not found.</li>
<li><code>BannedTable</code> =&gt; Banned Table detected.</li>
<li><code>ValueCannotBeEmpty</code> =&gt; Value Cannot be Empty.</li>
<li><code>InvalidDependencyPackName</code> =&gt; Invalid Dependecy PackFile</li>
<li><code>InvalidPackName</code> =&gt; Invalid Pack Name</li>
<li><code>DatacoredPortraitSettings</code> =&gt; Datacored Portrait Settings file.</li>
<li><code>InvalidArtSetId</code> =&gt; Invalid Art Set Id</li>
<li><code>InvalidVariantFilename</code> =&gt; Invalid Variant Filename</li>
<li><code>FileDiffuseNotFoundForVariant</code> =&gt; File Diffuse not found for Variant.</li>
</ul>
</li>
</ul>
</li>
<li>
<p><strong>Files to Ignore when Importing</strong>: Paths here will be ignored when importing into a MyMod.</p>
</li>
<li>
<p><strong>Disable Autosaves for this PackFile</strong>: For big PackFiles.</p>
</li>
</ul>
<div style="break-before: page; page-break-before: always;"></div><h1 id="notes"><a class="header" href="#notes">Notes</a></h1>
<p><img src="./images/notes.png" alt="Note me, Sempai..." /></p>
<p><code>Notes</code> is a system of simple notes stored in the PackFiles. It's just a way to keep non-standard things (like <em>"this column is for X, remember it when changing Y!"</em>) in your PackFiles. You can have one note per PackFile. Use it for whatever you want. For file-specific notes, use the Quick Notes system.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="global-search"><a class="header" href="#global-search">Global Search</a></h1>
<p><img src="./images/image15.png" alt="Gonna search you around the globe, with a satelite and infrared to see you move through the night..." /></p>
<p><code>Global Search</code> allows you to perform a simple search (accepts Regex) across every DB/Loc/Text file inside your PackFile (and the schema of the currently selected game), providing you with a filterable list of results in the right of the screen.</p>
<p>Pretty straightforward, just some notes:</p>
<ul>
<li>The search field will turn red/green depending if your text is a valid regex or not (if you enabled the regex option).</li>
<li>Schema fields are not replaceable.</li>
</ul>
<div style="break-before: page; page-break-before: always;"></div><h1 id="diagnostics-panel"><a class="header" href="#diagnostics-panel">Diagnostics Panel</a></h1>
<p><img src="./images/diagnostics.png" alt="Tell me, doctor, do I have the coronavirus?" /></p>
<p><code>Diagnostics</code> panel allows you to quickly identify possible problems in your mod, so you can fix them before they're reflected in-game.</p>
<p>It's pretty simple. From left to right:</p>
<ul>
<li><code>Check PackFile</code>: Performs a diagnostics check over the entire PackFile. If the relevant settings are enabled, this is done automatically on PackFile opening too.</li>
<li><code>Check Open PackedFile</code>: Performs a diagnostics check over the open PackedFiles, leaving the results of the other PackFiles as they are.</li>
<li><code>Error</code>: Enable showing error diagnostics.</li>
<li><code>Warning</code>: Enable showing warning diagnostics.</li>
<li><code>Info</code>: Enable showing info diagnostics.</li>
<li><code>Open PackedFiles Only</code>: Filter the diagnostics list to show only the diagnostics relevant to the open PackedFiles.</li>
<li><code>Show more filters</code>: Shows a toggleable list of per-diagnostic filter, for more granular filtering.</li>
</ul>
<p>To know more about what each diagnostic means, hover the mouse over them and you'll get an explanation of what it means. Also, double-clicking them will led you to the relevant place where they are being detected.</p>
<p>Also, something to note: while most diagnostics are automatic (they work without any setup needed), lua diagnostics (diagnostics to check if db keys in script are correct) need some setup by the modder. Specifically, the modder needs to write the following comment in the line above the variable, replacing table_name and column_name with the name of the table and column where that key should be:</p>
<pre><code class="language-lua">--@db table_name column_name [key=0,value=1]
</code></pre>
<p>Here are some examples with all the variable formats supported by these diagnostics:</p>
<pre><code class="language-lua">--@db battles key
hb = "chs_wastes_mountain_a_01"

--@db battles key
hb = { "chs_wastes_mountain_a_01", "chs_wastes_mountain_a_01" }

--@db battles key 0,1 (this checks both, key and value)
hb = { "chs_wastes_mountain_a_01" = "chs_wastes_mountain_a_01", "chs_wastes_mountain_a_01" = "chs_wastes_mountain_a_01" }

--@db battles key 0 (this checks only the keys)
hb = { "chs_wastes_mountain_a_01" = "chs_wastes_mountain_a_01", "chs_wastes_mountain_a_01" = "chs_wastes_mountain_a_01" }

--@db battles key 1 (this checks only the values)
hb = { "chs_wastes_mountain_a_01" = "chs_wastes_mountain_a_01", "chs_wastes_mountain_a_01" = "chs_wastes_mountain_a_01" }

--@db battles key
hb = {
    "chs_wastes_mountain_a_01",
    "chs_wastes_mountain_a_01"
}

--@db battles key 0,1 (this checks both, key and value)
hb = {
    "chs_wastes_mountain_a_01" = "chs_wastes_mountain_a_01",
    "chs_wastes_mountain_a_01" = "chs_wastes_mountain_a_01"
}

--@db battles key 0 (this checks only the keys)
hb = {
    "chs_wastes_mountain_a_01" = "chs_wastes_mountain_a_01",
    "chs_wastes_mountain_a_01" = "chs_wastes_mountain_a_01"
}

--@db battles key 1 (this checks only the values)
hb = {
    "chs_wastes_mountain_a_01" = "chs_wastes_mountain_a_01",
    "chs_wastes_mountain_a_01" = "chs_wastes_mountain_a_01"
}

</code></pre>
<div style="break-before: page; page-break-before: always;"></div><h1 id="dependencies-panel"><a class="header" href="#dependencies-panel">Dependencies Panel</a></h1>
<p><img src="./images/dependencies.png" alt="A dependant one?" /></p>
<p><code>Dependencies</code> panel allows you to quickly access any vanilla/parent file from RPFM, without having to load it to an open PackFile. It also allows you to import them to the currently open PackFile, and extract them to the filesystem. Only works if the dependencies cache has been generated.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="references-panel"><a class="header" href="#references-panel">References Panel</a></h1>
<p><code>References</code> panel allows you to list all references to a particular value found in both, your PackFile, and any loaded dependencies. To populate it, use the "Find References" table feature.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="quick-notes"><a class="header" href="#quick-notes">Quick Notes</a></h1>
<p>If you right-click in a file tab, and hit "Toggle Quick Notes", you can access the Quick Notes panel. This panel allows you to write notes that will always show up when you open files under a certain path. It's useful for TODO notes, or for documenting file-specific workarounds.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="editable-files"><a class="header" href="#editable-files">Editable Files</a></h1>
<p>As explained before, RPFM can not only edit the PackFiles of modern Total War Games, but it can also edit the Files inside them (PackedFiles, or just Files) without the need of extracting them. Ín this section we'll see what PackedFiles can RPFM see/edit.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="db-tables"><a class="header" href="#db-tables">DB Tables</a></h1>
<p><img src="./images/image16.png" alt="Tables... Not as plain as you!" /></p>
<p><code>DB Tables</code> are where most of the moddable data of the games is. For example, unit stats, faction colors, buildings info,... RPFM has a complete integrated editor for them. The screenshot above is how a DB Table looks in RPFM when opened.</p>
<p>The editor includes <em><strong>cross-table references</strong></em>, which means that, if one column references another table, you'll get a combo when editing that column with data to input from the other table. Also, if you hover over the header of any column that references another table, is referenced on another table, or <strong>has a description in the schema</strong>, you can see in the tooltip the column's special info.</p>
<p>Key columns are also marked with a slightly yellow background for recognition.</p>
<p>All columns are also <strong>movable</strong>, so you can rearrange them however you want, and numeric columns (except long integer columns) have a <strong>numeric-only editor</strong>. And you can sort the table by one column one way or another, or remove the sorting with a third click in the column title.</p>
<p>At the bottom of the window you have a <strong>real-time filter</strong>. Select the column you want to use to filter, if you want it to filter as <code>Case Sensitive</code>, and just write and see how the table gets filtered as you type. It works with Regex too. For example, the following will only show up the rows that contain in their <code>Key</code> column <code>v_b</code> or <code>fake</code>:</p>
<p><img src="./images/image17.png" alt="Filters.... Filters never change." /></p>
<p>Here you have a <em><strong>Regex Cheatsheet</strong></em> in case you want to use more complex filters: <a href="https://www.cheatography.com/davechild/cheat-sheets/regular-expressions/">https://www.cheatography.com/davechild/cheat-sheets/regular-expressions/</a></p>
<p>Also, you can add more filters with the <code>+</code> button, and make multi-column filters. You can even have multiple groups of multi-column filters to more accurate filters.</p>
<p>Now, with the Right-Click (or Contextual) Menu:</p>
<p><img src="./images/image18.png" alt="I just rightclicked and this showed up." /></p>
<p>These are all the actions available for DB Tables:</p>
<ul>
<li><code>Add Row</code>: Appends an empty row at the end of the table.</li>
<li><code>Insert Row</code>: Inserts an empty row after every row with a selected cell.</li>
<li><code>Delete Row</code>: Uses the computational power of your GPU to mine cryptocurrencies. Joking, it deletes any row with a selected cell.</li>
<li><code>Delete Filtered-Out Row</code>: It deletes any row not in the current filter.</li>
<li><code>Clone…/Clone and Insert</code>: Creates a duplicate of every row with a selected cell and inserts the duplicate just below the original row.</li>
<li><code>Clone…/Clone and Append</code>: Creates a duplicate of every row with a selected cell and appends the duplicates at the end of the table.</li>
<li><code>Copy …/Copy</code>: It copies whatever is selected to the Clipboard, in a format compatible with Excel, LibreOffice Calc and others.</li>
<li><code>Copy …/Copy as LUA Table</code>: It copies the entire table as a Lua "Map&lt;String, Vector&lt;data&gt;&gt;" if the table has a key field, or as a series of Vectors if it hasn't, ready to paste it in a script. For scripters.</li>
<li><code>Copy …/Copy as filter value</code>: It copies whatever is selected to the Clipboard, in a format which can be pasted in the filter input.</li>
<li><code>Go To …/Go To Definition</code>: If the first cell of the selection is a reference to another table, it tries to open the referenced table. If Dependencies cache has been generated, it'll even open tables from data.pack or equivalent in read-only views.</li>
<li><code>Go To …/Go To Loc Entry</code>: It tries to open the loc file containing the loc entry relevant for the selected row, if exists. If Dependencies cache has been generated, it'll even open locs from /data in read-only views.</li>
<li><code>Paste</code>: It tries to paste whatever is in the Clipboard to the selected cells. It does some clever things while pasting:
<ul>
<li>If only one cell was copied, it pastes it in all selected cells.</li>
<li>If only a few cells of a row were copied, and the amount of copied cells equals the amount of selected columns, it pastes the first item in every cell in the first selected column, the second item in every cell of the second selected column,...</li>
<li>If none of the above, it defaults to a normal paste.</li>
</ul>
</li>
<li><code>Paste as New Row</code>: It allows you to paste the contents of the clipboard as a new row, appended at the end of the table.</li>
<li><code>Generate IDs</code>: Allows you to generate a sequence of consecutive ids for the selected cells.</li>
<li><code>Rewrite Selection</code>: Allows you to rewrite the contents of a complete selection with whatever you want. It also allows for some limited numeric operations.</li>
<li><code>Invert Selection</code>: Inverse the selection state of all cells on the table.</li>
<li><code>Reset Selection</code>: Reset all selected cells to the value they had when the table was initially open.</li>
<li><code>Resize Columns</code>: Resize all the columns to fit their contents.</li>
<li><code>Import TSV</code>: Allows you to import a TSV file to the table, overwriting whatever the table currently has. <strong>IT'S NOT COMPATIBLE WITH PFM TSV FILES</strong>.</li>
<li><code>Export TSV</code>: Allows you to export the table as a TSV File, compatible with Excel, Calc….</li>
<li><code>Search</code>: Open the <em>Search &amp; Replace</em> panel, that you can use to search any text pattern you want in the table, and replace it if you want. It works in combination with the filter, so you can even do more precise searches combining them!</li>
<li><code>Sidebar</code>: Open a sidebar where you can select what columns hide/show and freeze/unfreeze.</li>
<li><code>Find References</code>: Performs a reference search for the value in the cell.</li>
<li><code>Rename References</code>: Allows you to rename in cascade all references to a key at once.</li>
<li><code>Patch Column Definition</code>: Patches a column definition with extended data.</li>
<li><code>Undo</code>: Allows you to undo… almost every action done in the table. Even TSV Imports.</li>
<li><code>Redo</code>: Allows you to undo every undo action. This goes deeper into the rabbit hole…</li>
</ul>
<p>Tables uses the same colour code for cells and rows as the TreeView. And that's more or less what you can do with a DB Table.</p>
<p>Apart of these, the <code>Del</code> key in DB Tables acts as an <code>Smart Delete</code> key. This means depending on what you have selected when you press <code>Delete</code> it'll delete:</p>
<ul>
<li><strong>If you have selected random cells</strong>, it'll delete their contents.</li>
<li><strong>If you have selected a full row</strong> , it'll delete the row from the table.</li>
<li><strong>If you have a combination of both</strong> , it'll delete rows where all cells are selected, and it'll delete the contents of the cells where not all cells in a row are selected. Fancy.</li>
</ul>
<p>One thing to take into account is that if you want to write multiple lines in a cell (for example, for multiple paragraphs in one single cell) you <strong>can write <code>\\n</code> and RPFM will take care of saving it properly</strong>, so you see multiple lines ingame. Same with <code>\\t</code> for tablulations. And yes, two bars, not one.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="loc-packedfiles"><a class="header" href="#loc-packedfiles">LOC PackedFiles</a></h1>
<p><img src="./images/image19.png" alt="Localizable at any hour...." /></p>
<p>Loc PackedFiles are files that end in <code>.loc</code>, and <strong>contain most of the texts you see ingame</strong>. When you open them, you can see they work like a… DB Table. They are really an special type of table, so you can do to them exactly the same stuff you do can do to DB Tables. Loc PackedFiles uses the same colour code for cells and rows as the TreeView.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="text-packedfiles"><a class="header" href="#text-packedfiles">Text PackedFiles</a></h1>
<p><img src="./images/image20.png" alt="It&#39;s textual, you know?" /></p>
<p>RPFM can open and edit a wide variety of Text PackedFiles, such as <code>XML, HTML, LUA, TXT,...</code>. It has native <strong>Undo/Redo support, Copy/Paste support, Syntax Highlighting...</strong> the normal things for a basic text editor.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="images"><a class="header" href="#images">Images</a></h1>
<p><img src="./images/image22.png" alt="Imagine how hard can be...." /></p>
<p>RPFM can open a variety of image formats, such as <strong>PNG, JPG, TGA, DDS (most of them)...</strong> Just select the image you want to see, and it'll open in the right side of the window. If it doesn't open, it's a format it cannot (yet) open.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="ca_vp8"><a class="header" href="#ca_vp8">CA_VP8</a></h1>
<p><img src="./images/image21.png" alt="Imagine how hard can be...." /></p>
<p>RPFM can decode the CA_VP8 video files CA uses in total war games, and convert them into VP8 IVF and back. Just press the button of the format you want, then press extract. Also, this is video only. No audio is converted.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="animpacks"><a class="header" href="#animpacks">AnimPacks</a></h1>
<p><img src="./images/animpacks.png" alt="Repacked for you...." /></p>
<p>RPFM can open AnimPacks, and allows to add/remove files at will to/from them. The left view represents the currently open PackFile. The right view, your AnimPack.</p>
<ul>
<li>To add files to your AnimPack, just double-click what you want to add on the left view, and it'll be added to the AnimPack on the right.</li>
<li>To Extract files from your AnimPack into the PackFile, just double-click the files you want to extract on the right view, and they'll be extracted into the left view.</li>
<li>To remove files from the AnimPack, just select them and hit "Delete".</li>
</ul>
<p>NOTE: All add/extract operations are copies, not moves. This means the original file will still be there after being added/extracted.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="animtables"><a class="header" href="#animtables">AnimTables</a></h1>
<p>AnimTables are DB-like tables with information about animations. Really, I'm not an expert on them. They're shown in debug views. Remember to hit the save button at the bottom or they'll not be saved.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="animfragments"><a class="header" href="#animfragments">AnimFragments</a></h1>
<p>AnimFraments are DB-like tables with information about what animations use what units on what situations. Really, I'm not an expert on them. They're shown in debug views. Remember to hit the save button at the bottom or they'll not be saved.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="matchedcombat-tables"><a class="header" href="#matchedcombat-tables">MatchedCombat Tables</a></h1>
<p>MatchedCombat Tables are DB-like tables with information about what animations use what units when they're in matched combat with other specific units. I think. Really, I'm not an expert on them. They're shown in debug views. Remember to hit the save button at the bottom or they'll not be saved.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="portrait-settings"><a class="header" href="#portrait-settings">Portrait Settings</a></h1>
<p><img src="./images/portrait_settings.png" alt="Like the monna lisa...." /></p>
<p>Portrait Settings are files that contain info about the different portraits (head/recruitment panel/details panel) a unit can use.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="audio-files"><a class="header" href="#audio-files">Audio files</a></h1>
<p>You can listen to audio files. Only .mp3 supported. That's all.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="rigidmodel-files"><a class="header" href="#rigidmodel-files">RigidModel files</a></h1>
<p>These are the 3D model files used by the game. RPFM offers limited edition capabilities for them, thanks to a separate library by Phazer. Windows-only.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="db-decoder"><a class="header" href="#db-decoder">DB Decoder</a></h1>
<p><img src="./images/image23.png" alt="Decoding your life, one step at a time." /></p>
<p>RPFM has an integrated <strong>DB decoder</strong>, to speed up a lot the decoding process of the <strong>definition</strong> of a table. It can be opened by right-clicking on a table file and selecting <code>Open/Open with Decoder</code>. Only works on tables.</p>
<p>The decoder screen is a bit complex so, like Jack the Ripper, let's check it in parts, one at a time. Starting by the left we have this:</p>
<p><img src="./images/image24.png" alt="Raw data... like raw meat, but less toxic." /></p>
<p>This is the <code>PackedFile's Data</code> view. It's similar to a hexadecimal editor, but far less powerful, and it's not editable. In the middle you have <strong>Raw Hexadecimal Data</strong>, and in the right, you have a <strong>Decoded version</strong> of that data. To make it easier to work with it, both scrolling and selection are synchronised between both views. So you can select a byte in the middle view, and it'll get selected in the right one too. The colour code here means:</p>
<ul>
<li><strong>Red</strong> : header of the table. It contains certain info about what's in the table, like his uuid, amount of rows,....</li>
<li><strong>Yellow</strong> : the part of the table already decoded following the structure from the fields table.</li>
<li><strong>Magenta</strong> : the byte where the next field after all the fields from the fields table starts.</li>
</ul>
<p>Next, to the right, we have this:</p>
<p><img src="./images/image25.png" alt="Fields.... like normal ones, but with less cows." /></p>
<p>This is the <code>Fields List</code>. Here are all the columns this table has, including their title, type, if they are a <code>key</code> column, their relation with other tables/columns, the decoded data on each field of the first row of the table, and a <em>Description</em> field, to add commentaries that'll show up when hovering the header of that column with the mouse.</p>
<p>If we right-click in any field of the table, we have these three self-explanatory options to help us with the decoding:</p>
<p><img src="./images/image26.png" alt="Moving up and down....." /></p>
<p>And finally, under the <code>Fields List</code>, we have this:</p>
<p><img src="./images/image27.png" alt="The guts of the decoder, exposed." /></p>
<p>The <code>Current Field Decoded</code> will show up the field that starts in the magenta byte of the <code>PackedFile's Data</code> view, decoded in the different types the tables use. It's use is simple: check what type makes more sense (for example, in the screenshot, it's evidently a <code>StringU8</code>), and click the <code>Use this</code> button in his row. Doing that will add a field of that type to the <code>Fields List</code>, and it'll update the <code>PackedFile's Data</code> View to show where the next field starts. Keep doing that until you think you've decoded the complete first row of the table, hit <code>Finish It!</code> at the right bottom corner, and select the table again. If the decoding is correct, the table will open. And that's how <s>I met your mother</s> you decode a table.</p>
<p>Under <code>Current Field Decoded</code> we have <code>Selected Field Decoded</code>. It does the same that <code>Current Field Decoded</code>, but from the byte you selected in the <code>PackedFile's Data</code> View. Just select a byte and it'll try to decode any possible field starting from it. It's for helping decoding complex tables.</p>
<p>To the right, we have some information about the table, and the <code>Versions List</code> (a list of versions of that table we have a definition for). If we right-click in one of them, we can load that version (useful to have something to start when a table gets <em>updated</em> in a patch) or delete it (in case we make a totally disaster and don't want it to be in the schema).</p>
<p>In the information of the table, the version number is only editable for version 0 tables. Usually, RPFM treats all versions as unique per-game, but version 0 really means <em><strong>no version</strong></em>, so in older games, like empire, there can be multiple "version 0" tables with different definitions. For that, when a version 0 table is decoded, you can set its version to be negative, which will act as an alternative definition for that version 0 table.</p>
<p>It's only for Empire/Napoleon. Don't use it in recent games.</p>
<p><img src="./images/image28.png" alt="Because no more is needed." /></p>
<p>And at the bottom, we have:</p>
<ul>
<li><code>Import from Assembly Kit</code>: it tries to import the definition for this table from the assembly kit files. It tries.</li>
<li><code>Test Definition</code>: test the definition to see if it can decode the table correctly. If it fails, it'll show a json version of the rows of the table that it could decode.</li>
<li><code>Remove all fields</code>: removes all decoded fields, returning the table to a clean state.</li>
<li><code>Finish It!</code>: Save the <code>Fields List</code> as a new definition for that version of the table in the schema. The definition is inmediatly available after that, so the changes can be used immediately.</li>
</ul>
<div style="break-before: page; page-break-before: always;"></div><h1 id="db-types"><a class="header" href="#db-types">DB Types</a></h1>
<p>People have complained that the types used in the DB Decoder and, by extension, in the tables are <em><strong>not intuitive enough</strong></em>, so here is a little explanation to shut you up:</p>
<ul>
<li><code>Bool</code>: One byte. Can be 00 or 01.</li>
<li><code>Float</code>, or <code>f32</code>: 4 bytes that represent a floating point number. Can be really anything.</li>
<li><code>Integer</code>, or <code>i32</code>: 4 bytes that represent a signed integer (admits negative numbers). Can be really anything.</li>
<li><code>Long Integer</code> or <code>i64</code>: 8 bytes that represent a signed integer (admits negative numbers). Can be really anything.</li>
<li><code>StringU8</code>: An UTF-8 String. It has an u16 (2 bytes) at the begining that specify his lenght, and then the String itself with each character encoded in one byte.</li>
<li><code>StringU16</code>: An UTF-16 String. It has an u16 (2 bytes) at the begining that specify his lenght, and then the String itself with each character encoded in two bytes.</li>
<li><code>OptionalStringU8</code>: Like a UTF-8 String, but with a bool before. If the bool is true, there is a <code>StringU8</code> after it. If it's false, <strong>then there is nothing more</strong> of that field after it.</li>
<li><code>OptionalStringU16</code>: Like a UTF-16 String. but with a bool before. If the bool is true, there is a <code>StringU16</code> after it. If it's false, then <strong>there is nothing more</strong> of that field after it.</li>
<li><code>SequenceU32</code>: It's a table inside a table.</li>
</ul>
<p>There are some extra types that RPFM doesn't yet support for one reason or another:</p>
<ul>
<li><code>OptionalInteger</code> (This one may not exists): Like an Integer, but with a bool before. If the bool is true, there is a <code>Integer</code> after it. If it's false, then there is nothing more of that field after it. Only seen in one table in Warhammer 2.</li>
</ul>
<p>If you need more help to understand these types, please search on google.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="appendix"><a class="header" href="#appendix">Appendix</a></h1>
<ul>
<li>Basic shortcuts (non-editable) for EVERY Table View provided by Qt:</li>
</ul>
<p><img src="./images/image29.png" alt="If I cut my arm, it&#39;ll be a shortcut or a longcut?" /></p>
<ul>
<li>
<p>If RPFM crashes, it'll generate an error log in his folder called "error-report-xxxxxxx.toml". That file can help me find the problem, so if you want to help reporting the bug, send me that file too.</p>
</li>
<li>
<p><strong>DON'T OPEN FILES WITH RPFM AND OTHER PROGRAMS LIKE PFM AND THE ASSEMBLY KIT AT THE SAME TIME</strong>!!!!! Just in case you don't realise the problem, let me explain it: to not fill your entire RAM with data you probably aren't going to need, RPFM only reads from disk when needed and what it needs. This means that, if you open the same file with another program, that program <strong>MAY LOCK YOUR FILE, CAUSING EITHER A CORRUPTED PACKFILE OR A VANISHED PACKFILE WHEN SAVING</strong>.</p>
</li>
<li>
<p>If you still want to do it, disable the <code>Use Lazy-Loading</code> Setting in the <code>Preferences</code> and the entire PackFile will be loaded to RAM. Weird things may still happen, but if the PackFile is loaded to RAM, you can just click <code>Save PackFile As...</code> and your PackFile will be saved properly.</p>
</li>
</ul>
<div style="break-before: page; page-break-before: always;"></div><h1 id="tutorials"><a class="header" href="#tutorials">Tutorials</a></h1>
<p>This section contains a bunch of small tutorials on how to use some of the not-so-evident features of RPFM, so even if you're familiar with RPFM, I recomend you give these a look, because you might be doing the same thing they explain in a more complicated-than-needed way.</p>
<ul>
<li><a href="./chapter_tutorials_translator.html">How To Translate A Mod</a></li>
<li><a href="./chapter_tutorials_optimizer.html">How To Optimize Your Mod</a></li>
<li><a href="./chapter_tutorials_twad_key_deletes.html">Datacores And You</a></li>
</ul>
<div style="break-before: page; page-break-before: always;"></div><h1 id="how-to-translate-a-mod"><a class="header" href="#how-to-translate-a-mod">How To Translate A Mod</a></h1>
<p>There are three ways to translate a mod: <strong>the simple way, the advanced way, and the new way</strong>.</p>
<h3 id="the-simple-way"><a class="header" href="#the-simple-way">The Simple Way</a></h3>
<p>It's the one new modders tend to do, because it's the easier one:</p>
<ul>
<li>Open the Pack.</li>
<li>Open the Loc files.</li>
<li>Manually translate the loc values.</li>
<li>Save the Pack.</li>
</ul>
<p>It's not recomended because when the mod gets an update, you have to retranslate everything, or figure out a way to find the new/changed lines, translate those, then update your translation mod. And this can be a pain, and depending on how you do it, you can miss line changes leaving your translation <em><strong>working but partially outdated</strong></em>.</p>
<h3 id="the-advanced-way"><a class="header" href="#the-advanced-way">The Advanced Way</a></h3>
<p>It's the one people that have been hit by the problems of the simple way tend to do:</p>
<ul>
<li>Open the Pack.</li>
<li>Extract all locs to TSV.</li>
<li>Use some software to help you translate the files.</li>
<li>Import the locs back.</li>
<li>Save the Pack.</li>
</ul>
<p>There are many variants of this, ranging from simple <strong>autotranslate everything with google</strong> (if you do this WITHOUT PROOFREADING AND FIXING THE TRANSLATION I wish you a really painful death), to advanced workflows to isolate new/changed lines and only update those.</p>
<p>The pros of this is <strong>translations are more easily updated</strong> and it's <strong>easier to keep track of the changes</strong>. The cons are... that <strong>it's more time-consuming</strong>.</p>
<h3 id="the-new-way"><a class="header" href="#the-new-way">The New Way</a></h3>
<p>The new way is using RPFM's integrated Translator. It's really simple:</p>
<ul>
<li>Open the Pack you want to translate.</li>
<li>Open the Translator (Tools/Translator).</li>
<li>Translate the lines marked as <em>Need Retranslation</em>.</li>
<li>Hit Accept.</li>
<li>Save the Pack.</li>
</ul>
<p>Why is this approach the recommended one? Because <strong>the translator does a lot of the heavy work</strong> for you, and fixes some problems that have historically plagued translations in Total War games. Specifically:</p>
<ul>
<li>It detects lines unchanged from the vanilla english translation, and translates them automatically using their official translation.</li>
<li>When translating submods, it reuses translations from the parent mods if they exists and autotranslates lines reused from the parent mods using them.</li>
<li>If you're updating a translation:
<ul>
<li>It detects lines which have been removed from the mod and marks them so you don't need to translate them.</li>
<li>It detects lines which have been altered on the mod, so you can update their translation.</li>
<li>It detects lines which are new, and promps you to translate them.</li>
</ul>
</li>
<li>Due to the way the translation data is stored, it's easy to share it with a team and collaborate on it.</li>
</ul>
<p>This means, just by using it, you get:</p>
<ul>
<li>No more time wasted updating a translation. Just open the updated mod in the translator, hit accept, and done.</li>
<li>No more lines changed in an update still using their old translation.</li>
<li>No more lines with the same text using different translations, leading to mismatching terminology.</li>
</ul>
<p>Additionally, these translations are used by TWPatcher to provide launch-time translation capabilities, meaning any launcher that uses TWPatcher (like Runcher) can automatically detect your mods, find translations for them, either online at the translation hub, or locally, and auto-apply them on runtime, fixing the dreaded <em>no text when no english</em> bug along the way. This means no more need to have 20 translation packs for your 20 mods!</p>
<h3 id="how-to-use-the-translator"><a class="header" href="#how-to-use-the-translator">How to use the Translator</a></h3>
<p><img src="./images/translator.png" alt="Estas usando este software de traduccion de forma incorrecta." /></p>
<p>First, open the mod in the translator. The list of localisation lines in the mod is on the left, with the following structure:</p>
<ul>
<li><strong>Key</strong>: Key of the loc line to translate</li>
<li><strong>Needs Retrasnlation?</strong>: If checked, the line needs to be translated, either because it's a new line, or because it was previously translated, but the mod changed that line at some point.</li>
<li><strong>Removed</strong>: If checked, the line is no longer in use in the mod. The translator automatically hides these.</li>
<li><strong>Original Value</strong>: The text that's in the mod in that line. Usually in english.</li>
<li><strong>Translated Value</strong>: The translated text for that line.</li>
</ul>
<p><img src="./images/translator_right_side.png" alt="Estas usando este software de traduccion de forma incorrecta." /></p>
<p>Next, the right side, where the configuration of the translator and the translation itself happens. At the top you have some instructions on how to use the tool and the language the translator is translating into, which is chosen based on which language you have the game on. Next is the <strong>Auto-translation behavior</strong> section, where you can configure how the translator acts every time you select/deselect a line from the list to translate:</p>
<ul>
<li>When you select a new line:
<ul>
<li><strong>Auto-translate with DeepL</strong>: it uses DeepL to automatically translate the line, providing rather high quality translations in general. To use this, you have to make an account in the <a href="https://www.deepl.com/">DeepL Webpage</a>, then generate an API Key, then set that API key in RPFM's settings.</li>
<li><strong>Auto-translate with ChatGPT</strong>: it uses ChatGPT to automatically translate the line, providing translations ranging from medium quality, to absolute garbage. You can use the context panel to provide context to ChatGPT for the translation. To use it you need to generate a ChatGPT API Key, then set that API Key in RPFM's settings.</li>
<li><strong>Auto-translate with Google Translate</strong>: it uses Google Translate to automatically translate the line, providing rather mediocre translations, but it's better than nothing.</li>
<li><strong>Copy Source Value</strong>: just reuse the original english value for that line without translating it.</li>
<li><strong>Empty Translated Value</strong>: do nothing when selecting a new line. Just provide an empty field to make the translation yourself, or to load a translation to the preview panel and not save it afterwards.</li>
</ul>
</li>
<li>When you save the current line:
<ul>
<li><strong>Replicate Edit in Pre-Translated Lines</strong>: the translator by default searches for all the untranslated lines with the exact same original text as the one you're translating and re-uses the same translation for them. Select this if you want it to also do the same for lines already translated.</li>
<li><strong>Only Edit the Current Line</strong>: fully disable the reusing of translations across lines with the same value.</li>
</ul>
</li>
</ul>
<p>After that there's a key field, so you can see the full key of whatever you're translating, and then there's the <strong>Original Value</strong> and <strong>Translated Value</strong> sections, which are composed of four panels and a couple of buttons:</p>
<ul>
<li>
<p>Original Value:</p>
<ul>
<li>Left Panel: original text with minimal formatting (\n and \t are replaced with their formatted variants).</li>
<li>Right Panel: original text with full formatting. Here you can see icons, coloured text, links,... more or less how it looks ingame.</li>
</ul>
</li>
<li>
<p>Translated Value:</p>
<ul>
<li>Buttons: button list to change to the previous/next line, or to perform one of the actions that usually happens when selecting a new line, but on demand.</li>
<li>Left Panel: translated text with minimal formatting (\n and \t are replaced with their formatted variants). <strong>Here is where you can edit the translation</strong>.</li>
<li>Right Panel: translated text with full formatting. Here you can see icons, coloured text, links,... more or less how it looks ingame.</li>
</ul>
</li>
</ul>
<p>So, how it works? You select a line, that line it's loaded in the right side of the window, you translate it, then select another line,... and once you're done, hit accept. That's all. When saving the translation, RPFM saves it to two places:</p>
<ul>
<li><strong>The Open Pack</strong>: it saves the entire translation into either <code>text/!!!!!!translated_locs.loc</code> or <code>text/localisation.loc</code>, depending on the game, so you can just use that pack translated.</li>
<li><strong>The Disk</strong>: it also saves the translation data into <code>RPFM_CONFIG_FOLDER/config/translations_local/GAME_KEY/MOD_PACK_NAME/XX.json</code>. This file is what RPFM uses to keep track of what changes in the translation, how to update it when the mod updates,... so don't delete it. And this is also what TWPatcher uses to do the launch-time translation.</li>
</ul>
<h3 id="how-to-share-a-translation"><a class="header" href="#how-to-share-a-translation">How to share a translation</a></h3>
<p>This is simple. Just grab the json file of the translation, and upload it <a href="https://github.com/Frodo45127/total_war_translation_hub">here</a>. Why it's good to share?</p>
<ul>
<li>In RPFM, the translator automatically searches for translations for mods in this repo. Meaning if someone translated a mod a year ago and uploaded it here, the Translator will update that translation and reuse it, so <strong>you don't have to retranslate the whole mod again</strong>.</li>
<li>When launched, TWPatcher automatically pulls this github repo and looks for translations on it to perform the automatic launch-time translation.</li>
</ul>
<p>So basically, sharing it makes it future-proof. And allows others to use it withouh having to worry about submods, extra outdated packs, custom upcs... Because live can be easy, and the cost was just me spending some time setting this up.</p>
<p>So basically, it's like doing it the Simple Way, but faster and with the benefits of the Advanced Way.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="how-to-optimize-your-mod"><a class="header" href="#how-to-optimize-your-mod">How To Optimize Your Mod</a></h1>
<p>First, why you should optimize your mod:</p>
<ul>
<li><strong>Size</strong>: optimizing your mod removes non-needed data from it, resulting in <strong>smaller Packs</strong>.</li>
<li><strong>Compatibility</strong>: optimizing your mod removes duplicated db and loc rows, unchanged rows vs vanilla... These rows <strong>tend to be left forgotten in mod packs</strong> (even when the diagnostics will warn you about them!!!) <strong>and end up causing compatibility issues</strong> when another mod tries to modify them, and your mod accidentally overwrite them for no reason.</li>
<li><strong>Multi-Language Support</strong>: optimizing your mod removes unchanged loc entries. This is important because, depending on the game, these loc entries will overwrite the player's localisation files if said player doesn't have the game in english. This means <strong>you're not changing these lines, but they'll turn to english for the players</strong>. Which is bad.</li>
</ul>
<p>Next, how to do it? You have two options:</p>
<ul>
<li><em><strong>Special Stuff/Game/Optimize Pack</strong></em>: optimizes the Pack but it doesn't save it, so you can review the optimized Pack.</li>
<li><em><strong>Pack/Save Pack for Release</strong></em>: optimizes the Pack and saves it.</li>
</ul>
<p>Last, when to do it? Before releasing the mod/update. And that's all.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="datacores-and-you"><a class="header" href="#datacores-and-you">Datacores And You</a></h1>
<h3 id="what-is-a-datacore"><a class="header" href="#what-is-a-datacore">What is a "datacore"?</a></h3>
<p>To explain what a datacore is, first we need to explain how table lines are loaded. Imagine the following table setup:</p>
<ul>
<li><strong>db/whatever_tables/@table</strong></li>
<li><strong>db/whatever_tables/ztable</strong></li>
<li><strong>db/whatever_tables/data__</strong>  (this is the vanilla table, may vary in some games)</li>
</ul>
<p>When loading ingame, those three tables are kinda merged into one, and when two lines of that merged table have the same key values, only the first line loads.
Meaning:</p>
<ul>
<li><strong>db/whatever_tables/@table</strong>: This contains new lines and lines intended to overwrite vanilla lines. For example, if you just want to change a value from a vanilla line, you put it here and change the value here.</li>
<li><strong>db/whatever_tables/ztable</strong>: This contains new lines that, in case of conflict, you want overwritten. Like vanilla fixes and things like that.</li>
<li><strong>db/whatever_tables/data__</strong>: This contains the vanilla data.</li>
</ul>
<p>Now you may notice there's a specific situation I haven't mentioned. What do you do if you want to remove lines from a table? For example, how do you remove an effect from a building? You have only one way: overwrite the entire table in your mod with the line removed. <strong>That's what's called 'Datacoring'</strong>.</p>
<h3 id="why-is-bad"><a class="header" href="#why-is-bad">Why is bad?</a></h3>
<p>A simple example: imagine you have this fancy effects table, and you want to remove one of the effects in a submod. You import the table into your submod, edit it, and it works. Until.... the parent mod is updating adding new effects. Now your submodded table doesn't have those new effects, meaning either you update your table with the new effects, or it will cause unintended removal of effects. And what if another submod tries to remove a different effect? Then a highlander situation happens: <strong>there can only be one</strong>.</p>
<p>In summary, datacoring, while useful for a specific situation, reduces the compatibility of the mod, makes the mod way bigger than it needs to be and increases the maintenance burden on the modder. So it should be avoided unless it's really needed. And starting with Warhammer 3, patch 6.3, it should no longer be needed.</p>
<h3 id="datacores-begone"><a class="header" href="#datacores-begone">Datacores BEGONE!!!</a></h3>
<p>In Warhammer 3, starting with patch 6.3, RPFM can now create a new table called <em>twad_key_deletes_tables</em>. This is a simple <code>table_name/key</code> table, and its purpouse is to perform a runtime deletion of keys from tables, replacing the need for datacoring tables. There are three ways to use it:</p>
<ul>
<li><em><strong>If you have a mod with datacores</strong></em>: Go to <code>Special Stuff/Warhammer 3/Optimize PackFile</code>, check the <code>DB &amp; Loc Files/Import datacores into twad_key_deletes</code> checkbox, and hit <code>Accept</code>. This will analyze all your datacores and add the removed entries into a new twad_key_deletes table. After that you can make sure all the relevant entries are there, and then delete the datacores. <strong>It's recommended you rename the new generated table</strong>, because RPFM will overwrite it if you repeat this process again.</li>
</ul>
<p><img src="./images/tut_twad_key_deletes_opt.png" alt="Optimize me baby...." /></p>
<ul>
<li><em><strong>If you just want to ignore some lines</strong></em>: First, create the table like a normal db (right-click the pack, then <code>Create/Create DB</code>, select it from the combobox, give it a name and and hit accept). Once the table exist in your pack, <em><strong>YOU DO NOT NEED TO EDIT IT MANUALLY</strong></em>. In fact, due to the way keys are shown in RPFM, specially in multikey tables, if you try to input a key manually in the twad_key_deletes table chances are you write it wrong and you won't notice it until you start the game. Instead, go to the table you want to remove the lines from, select them, right-click, <code>Add Selection to Key Deletes</code> and click on your new table. This will automatically add the keys of the selected rows to the twad_key_deletes table you created. Magic!</li>
</ul>
<p><img src="./images/tut_twad_key_deletes_add_to_deletes.png" alt="And this is how magic is made...." /></p>
<ul>
<li><em><strong>If you have no other way to do what you want to do, you can edit the <code>twad_key_deletes</code> table like any other table</strong></em>. This is only recommended for situations not covered by the other two methods (like deleting a row from the table) because it can otherwise lead to incorrect/non-working entries being added into the new table, that RPFM can't yet detect as errors. And... it'll take you forever to add 10.000 keys this way.</li>
</ul>
<h3 id="but-it-is-gold-all-that-glitters"><a class="header" href="#but-it-is-gold-all-that-glitters">But it is gold all that glitters?</a></h3>
<p>Now, while this allows modders to finally get rid of datacores, there are some caveats that one has to take into account:</p>
<ul>
<li>
<p>The effect ingame is like if we remove a line from the db. This means <strong>if you remove a line that's referenced in another table, chances are your mod's going to crash the game</strong>. Just like if you remove a line from <code>land_units</code> in a datacore and don't remove all the references to said unit. Though this time is worse, because RPFM's diagnostics cannot detect this kind of broken reference (yet) and if the game warns you about it in a dialog when it crashes, it may point you to the wrong pack. So if used without the proper though, this can cause more problems than it solves.</p>
</li>
<li>
<p><strong>Load order matters</strong>: Meaning if a mod removes a line, then a lower priority mod adds it back, the line will be removed, then added back.</p>
</li>
</ul>
<div style="break-before: page; page-break-before: always;"></div><h1 id="compilation-instructions"><a class="header" href="#compilation-instructions">Compilation Instructions</a></h1>
<p>Just in case someone wants to collaborate with code (who knows, maybe there is someone out there in the wild) here are the <strong>instructions to compile RPFM</strong> in the different supported OS:</p>
<h2 id="windows"><a class="header" href="#windows">Windows</a></h2>
<p>You need to download and install:</p>
<ul>
<li><a href="https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk"><em><strong>Windows SDK</strong></em></a>.</li>
<li><em><strong>Visual Studio Community 2019</strong></em> (from <a href="https://download.visualstudio.microsoft.com/download/pr/e84651e1-d13a-4bd2-a658-f47a1011ffd1/e17f0d85d70dc9f1e437a78a90dcfc527befe3dc11644e02435bdfe8fd51da27/vs_Community.exe">here</a>, because microsoft kinda hides the link). 2022 is not supported, use 2019.</li>
<li><em><strong>MSVC</strong></em> (from the Visual Studio 2019 installer).
<ul>
<li>Once this is installed, create the VCTOOLSREDISTDIR user env variable, and point it to "C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\xx.xx.xxxxx" or wherever MSVC got installed.</li>
</ul>
</li>
<li><em><strong>Rust 1.64 with the MSVC toolchain</strong></em> (or superior).</li>
<li><em><strong>Craft</strong></em> (from KDE).</li>
</ul>
<p>Once you have Craft installed, you need to install RPFM's dependencies:</p>
<pre><code class="language-bash">craft -i qtimageformats
craft -i kimageformats
craft -i kwidgetsaddons
craft -i ktexteditor
craft -i kiconthemes
craft -i breeze-icons
</code></pre>
<p>NOTE: You may need to specify you want the QT5 version of those libs. Like this:</p>
<pre><code class="language-bash">craft -i libs/qt5/qtimageformats
</code></pre>
<p>Now you can open craft, move to RPFM's source code folder and call from that terminal:</p>
<pre><code class="language-bash"># To build the executable without optimisations.
cargo build

# To run the ui executable without optimisations (debug mode).
cargo run --bin rpfm_ui

# To build the executable with optimisations (release mode).
cargo build --release
</code></pre>
<p>You can also make any editor inherit Craft's environment (and thus, being able to compile RPFM) by opening it from Craft's Terminal.
Note that some features, like the entire Tools menu, may require a feature flag to be enabled to work. You can check all the feature flags available in rpfm_ui/Cargo.toml, under [Features]. You can pass them like this:</p>
<pre><code class="language-bash"># To run the ui executable without optimisations (debug mode).
cargo run --bin rpfm_ui --features "example_feature,example_feature_2"
</code></pre>
<h2 id="linux"><a class="header" href="#linux">Linux</a></h2>
<p>You need to install the following packages on your distro:</p>
<ul>
<li><em><strong>CMake</strong></em>.</li>
<li><em><strong>Rust 1.64</strong></em> (or superior).</li>
<li><em><strong>Qt 5.14</strong></em> (or superior).</li>
<li><em><strong>KDE Framework (KF5) 5.61 (or superior)</strong></em>.</li>
<li><em><strong>xz</strong></em>.</li>
<li><em><strong>p7zip</strong></em>.</li>
</ul>
<p>Then just move to RPFM's source code and execute:</p>
<pre><code class="language-bash"># To build the executable without optimisations.
cargo build

# To run the ui executable without optimisations (debug mode).
cargo run --bin rpfm_ui

# To build the executable with optimisations (release mode).
cargo build --release
</code></pre>
<p>Note that some features, like the entire Tools menu, may require a feature flag to be enabled to work. You can check all the feature flags available in rpfm_ui/Cargo.toml, under [Features]. You can pass them like this:</p>
<pre><code class="language-bash"># To run the ui executable without optimisations (debug mode).
cargo run --bin rpfm_ui --features "example_feature,example_feature_2"
</code></pre>
<h2 id="macos"><a class="header" href="#macos">MacOS</a></h2>
<p>Don't know. Don't have a Mac to compile to it and test. I tried, it compiles, but its fully untested.</p>
<hr />
<p>In case you just want to <strong>contribute to these docs</strong>, you just need to download this repo, install Rust, then move to the repo's folder and:</p>
<pre><code class="language-bash"># To install mdbook.
cargo install mdbook

# To build the docs and open them in a browser.
mdbook build --open
</code></pre>
<p>These last instructions should work in any OS where you can install Rust on.</p>
<h2 id="flags"><a class="header" href="#flags">Flags</a></h2>
<p>About the flags available (this list may be incomplete):</p>
<ul>
<li>
<p><strong>strict_subclasses_compilation</strong>: Forces a compilation failure if the qt_rpfm_subclasses lib fails to compile.</p>
</li>
<li>
<p><strong>support_rigidmodel</strong>: Compiles RPFM with the RigidModel editor enabled. This requires a .lib file that's not public and whose source code was lost.</p>
</li>
<li>
<p><strong>support_model_renderer</strong>: Compiles RPFM with the 3d Renderer enabled. This has some extra requirements:</p>
<ul>
<li>Nuget: You can get it from here: https://dist.nuget.org/win-x86-commandline/latest/nuget.exe. Download it and drop it in the root folder of the repo.</li>
<li>You need to create the env var "QtToolsPath" and point it to the bin folder of your Qt installation.</li>
</ul>
</li>
<li>
<p><strong>support_modern_dds</strong>: Compiles RPFM with support for DDS files. Same deal with the rigidmodel one, source was lost.</p>
</li>
<li>
<p><strong>support_uic</strong>: Compiles RPFM with support for UIC files. Was never finished.</p>
</li>
<li>
<p><strong>support_soundbank</strong>: Compiles RPFM with support for SoundBank files. Was never finished.</p>
</li>
<li>
<p><strong>enable_tools</strong>: Compiles RPFM with support for tools. Optional because it adds a significant lenght of time to compilation.</p>
</li>
<li>
<p><strong>only_for_the_brave</strong>: The first time a version of RPFM is executed it shows a dialog with a specific message. For updates that may require to inform the user of something.</p>
</li>
</ul>

                    </main>

                    <nav class="nav-wrapper" aria-label="Page navigation">
                        <!-- Mobile navigation buttons -->


                        <div style="clear: both"></div>
                    </nav>
                </div>
            </div>

            <nav class="nav-wide-wrapper" aria-label="Page navigation">

            </nav>

        </div>




        <script>
            window.playground_copyable = true;
        </script>


        <script src="elasticlunr.min.js"></script>
        <script src="mark.min.js"></script>
        <script src="searcher.js"></script>

        <script src="clipboard.min.js"></script>
        <script src="highlight.js"></script>
        <script src="book.js"></script>

        <!-- Custom JS scripts -->

        <script>
        window.addEventListener('load', function() {
            window.setTimeout(window.print, 100);
        });
        </script>


    </div>
    </body>
</html>
